<?php
/**
 * 微课中间页
 */
namespace frontend\controllers;

use bc\controller\FrontController;
use bc\util\Util;

class CourseController extends FrontController
{
	
	protected $shareContent = '奥运冠军の营养师，教你在月子期吃嘛嘛对，喂奶无忧不长胖~';
	
	protected $shareDesc = '奥运冠军の营养师，教你在月子期吃嘛嘛对，喂奶无忧不长胖~';
	
	protected $shareUrl = 'http://wx.zhishimama.com/course';
	
	
	public function actionIndex()
	{
		$device = Util::getBroswer ();
		$view = [ ];
		
		$is_show = $this->get('is_show', 0);
		
		if ($device == 'wechat')
		{
			// 生成js sdk签名
			$jsConfig = $this->configJsApi ();
			$appid = $this->wechat ()->appid;
			$secret = $this->wechat ()->secret;
			$view ['share_url'] = $this->shareUrl;
			$view ['share_content'] = $this->shareContent;
			$view ['share_desc'] = $this->shareDesc;
			$view ['js_config'] = $jsConfig;
		}
		
		$view ['device'] = $device;
		$view ['is_show'] = $is_show;
		
		return $this->render ( 'index', $view );
	}
}

